﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;

using MefContrib.Hosting.Generics;

using NuMetaheuristics;

namespace NuMetaheuristics.Algorithms
{
    /// <summary>
    /// This class is used to facilitate truly generic algorithms which are 
    /// also extensible. This is made possible by MefContrib, which supports
    /// exporting using open generics.
    /// </summary>
    [Export(typeof(IGenericContractRegistry))]
    public class Algorithms : GenericContractRegistryBase
    {
        protected override void Initialize()
        {
            Register(typeof(IAlgorithm<>), typeof(HillClimbingAlgorithm<>));
            Register(typeof(IAlgorithm<>), typeof(ParticleSwarmAlgorithm<>));
        }
    }
}
